import HomePage from '../pages/home.vue';
import NotFoundPage from '../pages/404.vue';
const todoPage = () => import('../pages/todo.vue');

const SearchPage = () => import('../pages/components/search.vue')
const wechatBindPage = () => import('../pages/wechat/bind/add.vue')

// 课程
const eduListPage = () => import('../pages/edu/list.vue')
const eduDetailPage = () => import('../pages/edu/detail.vue')
const personPage = () => import('../pages/person/index.vue')
const myeduListPage = () => import('../pages/person/list.vue')
const myeduDetailPage = () => import('../pages/person/detail.vue')

// 故事
const storyListPage = () => import('../pages/story/list.vue')
const storyAddPage = () => import('../pages/story/add.vue')
const storyDetailPage = () => import('../pages/story/detail.vue')


var routes = [
  {
    path: '/',
    component: HomePage,
  },
  {
    path: '/story-list/',
    async(routeTo, routeFrom, resolve) {
      storyListPage
      storyListPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },
  {
    path: '/story-add/',
    async(routeTo, routeFrom, resolve) {
      storyAddPage
      storyAddPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },
  {
    path: '/story-detail/',
    async(routeTo, routeFrom, resolve) {
      storyDetailPage
      storyDetailPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },
  {
    path: '/edu-list/',
    async(routeTo, routeFrom, resolve) {
      eduListPage
      eduListPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },
  {
    path: '/edu-detail/',
    async(routeTo, routeFrom, resolve) {
      eduDetailPage
      eduDetailPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },
  {
    path: '/my-edu-list/',
    async(routeTo, routeFrom, resolve) {
      myeduListPage
      myeduListPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },
  {
    path: '/my-edu-detail/',
    async(routeTo, routeFrom, resolve) {
      myeduDetailPage
      myeduDetailPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },
  {
    path: '/person-index/',
    async(routeTo, routeFrom, resolve) {
      personPage
      personPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },


  {
    path: '/wechat-bind/',
    async(routeTo, routeFrom, resolve) {
      wechatBindPage
      wechatBindPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },
  {
    path: '/todo-index/',
    async(routeTo, routeFrom, resolve) {
      todoPage
      todoPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },
  {
    path: '/SearchPage/',
    async(routeTo, routeFrom, resolve) {
      SearchPage
      SearchPage().then((vc) => {
        resolve({ component: vc.default })
      });
    },
  },

  {
    path: '(.*)',
    component: NotFoundPage,
  },
];

export default routes;